{	Problem: http://codeforces.ru/problemset/problem/108/A
	Verdict: Accepted
}
uses
        SysUtils, Math;

var
    x, y : longint;
    s, t : string;

function make(n : longint) : string;
begin
    result := inttostr(n);
    if length(result) = 1 then result := '0' + result;
end;
                
begin 
        readln(s);
    x := strtoint(s[1] + s[2]);
    y := strtoint(s[4] + s[5]);
    while true do begin
        y := (y + 1) mod 60;
        if y = 0 then x := (x + 1) mod 24;
        t := make(x);
        s := make(y);
        if (s[1] = t[2]) and (s[2] = t[1]) then begin
            write(t, ':', s);
            halt(0);
        end;
    end;                
end.
